#ifndef __MOTOR_H
#define __MOTOR_H

#include "main.h"

typedef struct
{
    GPIO_TypeDef *GPIOx;
    uint16_t GPIO_Pin;
}ControlPin;

typedef struct
{
    ControlPin pin1;
    ControlPin pin2;
    TIM_HandleTypeDef *htim;
    uint32_t Channel;
}ControlChannel;

//typedef struct
//{
//    uint8_t id;
//    int8_t direction;
//    uint8_t speed;
//    TIM_HandleTypeDef *htim;
//    uint32_t Channel;
//    ControlPin pin1;
//    ControlPin pin2;
//}Motor;

void motorInit(void);
//void motorSetSpeed(Motor *motor, int8_t speed);
//void motorRefresh(Motor *motor);
void motorSetPWM(ControlChannel *channel, int pwmVal);

#endif
